<template>
    <div class="news-dynamics-section">
      <h2 class="section-title">资讯动态</h2>
      <el-row :gutter="20">
        <el-col v-for="(news, index) in newsList" :key="index" :span="12">
          <el-card class="news-card">
            <div slot="header" class="news-header">
              <span class="news-date">{{ news.date }}</span>
            </div>
            <div class="news-body">
              <h3 class="news-title">{{ news.title }}</h3>
              <p class="news-description">{{ news.description }}</p>
              <a :href="news.link" class="news-more" target="_blank">查看详情</a>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </template>

<script>
import { defineComponent, ref } from 'vue';

export default defineComponent({
  name: 'NewsDynamicsSection',
  setup() {
    const newsList = ref([
      {
        date: '2023-10-05',
        title: '斑马中国升级版权保护服务，助力创作者权益',
        description: '斑马中国近期对其版权保护服务进行了全面升级，旨在更好地保障创作者的合法权益。',
        link: 'https://www.bmark.cn/news/latest-1',
      },
      {
        date: '2023-10-04',
        title: '版权交易市场动态：斑马中国引领行业发展',
        description: '斑马中国在版权交易市场中的表现日益突出，成为引领行业发展的重要力量。',
        link: 'https://www.bmark.cn/news/latest-2',
      },
      // 根据实际新闻动态添加更多数据
    ]);

    return {
      newsList,
    };
  },
});
</script>
  
<style scoped>
.news-dynamics-section {
  padding: 20px;
}

.section-title {
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
}

.news-card {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s;
}

.news-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.news-header {
  padding: 10px;
  background-color: #f5f7fa;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.news-date {
  font-size: 14px;
  color: #999999;
}

.news-body {
  padding: 15px;
}

.news-title {
  font-size: 18px;
  margin-bottom: 10px;
}

.news-description {
  font-size: 14px;
  color: #666666;
  line-height: 1.5;
}

.news-more {
  display: block;
  font-size: 14px;
  color: #409EFF;
  text-decoration: none;
  margin-top: 10px;
}

.news-more:hover {
  text-decoration: underline;
}
</style>
